@echo off
echo ========================================
echo AI动画生成系统 - Windows安装脚本
echo ========================================
echo.

echo 检查Python环境...
python --version
if %errorlevel% neq 0 (
    echo 错误: 未找到Python，请先安装Python 3.9+
    pause
    exit /b 1
)

echo.
echo 检查conda环境...
conda --version
if %errorlevel% neq 0 (
    echo 错误: 未找到conda，请先安装Anaconda或Miniconda
    pause
    exit /b 1
)

echo.
echo 创建conda环境...
conda create -n ai-animation python=3.9 -y
if %errorlevel% neq 0 (
    echo 错误: 创建conda环境失败
    pause
    exit /b 1
)

echo.
echo 激活环境并安装依赖...
call conda activate ai-animation

echo 安装PyTorch...
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia -y

echo 安装基础依赖...
pip install numpy scipy matplotlib pillow opencv-python tqdm requests

echo 安装AI框架...
pip install transformers diffusers accelerate xformers

echo 安装视频处理...
pip install moviepy imageio imageio-ffmpeg scikit-image

echo 安装Web框架...
pip install gradio streamlit fastapi uvicorn

echo 安装其他工具...
pip install huggingface-hub safetensors einops

echo.
echo 创建项目目录...
mkdir data\input data\output data\temp models logs configs 2>nul

echo.
echo 安装完成！
echo.
echo 使用方法:
echo 1. 激活环境: conda activate ai-animation
echo 2. 启动Web界面: python main.py web_ui
echo 3. 或运行演示: python demo.py
echo.
echo 按任意键退出...
pause >nul 